<!-- <div class="row project common"> -->
<?php if ($request == 'main_page'):?>
<script>
$(function() {
	$('#project_carousel').tinycarousel({ 'display': 3 });
	
	$("ul.overview li a").colorbox({
		initialWidth: '440px',
		initialHeight: '280px',
		title: true,
		onOpen: function() {
			/* cboxPage */
			$("#cboxBottomCenter").html('<div id="cboxPage"></div>');

			$(this).parent().children('a').each(function() {
				$("#cboxPage").append('<span class="cboxPageBtn"></span>');
			});

			var btn_num = $(this).parent().children('a').size();
			var cboxPage_width = (parseFloat($(".cboxPageBtn").css('width')) + parseFloat($(".cboxPageBtn").css('margin-right'))) * btn_num;
			$("#cboxPage").css({ 'width': cboxPage_width });
			/* cboxPage */
		},
		onLoad: function() {
			$("#carousel_title div").html('');
			var parent_li = $(this).parent("li");
			if (parent_li.attr('name') != '') {
				$("#carousel_title #name").html(parent_li.attr('name'));
			}
			if (parent_li.attr('year') != '') {
				$("#carousel_title #year").html(parent_li.attr('year') + '<span class="unit">年</span>');
			}

			/* cboxPage */
			var rel = $(this).attr('rel');
			var current = $("ul.overview li a[rel='" + rel + "']").index(this);
			$("#cboxPage span").siblings().removeClass('active');
			$("#cboxPage span").eq(current).addClass('active');
			/* cboxPage */
		},
		onCleanup: function() {
			$("#carousel_title div").html('');
		}
	});

	$("ul.overview li").each(function() {
		var first_a = $(this).children("a:first");
		if (first_a.attr('href') == '') {
			var href = first_a.next().attr('href');
			first_a.attr('href', href);
			first_a.next().remove();
		}
	});

	/*$("#cboxPage span.cboxPageBtn").live('click', function() {
		jump_to_index = $(this).index();
		$.colorbox.jump_to(jump_to_index);
	});*/

	$().containerSimulator();
});
</script>
	<div class="span12 center-content">
		<div class="inner-content">
			<div id="project_carousel">
				<a class="buttons prev" href="#">《</a>
				<div class="viewport">
					<ul class="overview">
						<?php if ($content):?>
						<?php foreach ($content as $k => $v):?>
						<li id="<?php echo $v['id']?>" name="<?php echo (isset($v['name']) ? $v['name'] : '')?>" year="<?php echo (isset($v['year']) ? $v['year'] : '')?>" >
							<?php if ($v['pic']):?>
							<?php foreach ($v['pic'] as $k1 => $v1):?>
							<a href="<?php echo $v1['photo_path']?>" rel="cb_img<?php echo $k + 1 ?>">
								<?php if ($v1['weight'] == 1):?>
								<img src="<?php echo $v1['thumb_path']?>">
								<?php endif;?>
							</a>
							<?php endforeach;?>
							<?php endif;?>
						</li>
						<?php endforeach;?>
						<?php endif;?>
					</ul>
				</div>
				<a class="buttons next" href="#">》</a>
			</div>
		</div>
	</div>
	<div id="carousel_title">
		<div id="name"></div>
		<div id="year"></div>
	</div>
<?php elseif ($request == 'sub_page'):?>
	<div class="span8">
		
	</div>
<?php endif;?>
<!-- </div> -->